package com.sq.partner.manager.service.impl;
import java.util.Map;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.sq.partner.manager.dao.XBTSwitchDao;
import com.sq.partner.manager.mybatis.model.CoreDept;
import com.sq.partner.manager.mybatis.model.XbtSwitchDto;
import com.sq.partner.manager.service.XBTSwitchService;
import com.sq.partner.manager.util.LogUtil;
import com.sq.partner.manager.util.Page;

@Service
public class XBTSwitchServiceImpl implements XBTSwitchService {
	private static Logger logger = LogUtil.getLog(XBTSwitchServiceImpl.class);
	@Autowired
	private XBTSwitchDao xbtSwichDaoImp;
	@Override
	public Page<CoreDept> queryDeptPageByCriteria(Page<CoreDept> page)
			throws Exception {
		return xbtSwichDaoImp.queryDeptPageByCriteria(page);
	}
	@Override
	public Page<XbtSwitchDto> querySwichList(Page<XbtSwitchDto> page)
			throws Exception {
		return xbtSwichDaoImp.querySwichList(page);
	}
	@Override
	public boolean addXbtSwitchDto(XbtSwitchDto xbtSwitchDto) throws Exception {
		// TODO Auto-generated method stub
		return xbtSwichDaoImp.addXbtSwitchDto(xbtSwitchDto);
	}
	@Override
	public void deleteXbtSwitchDto(String deptCode) throws Exception {
		// TODO Auto-generated method stub
		xbtSwichDaoImp.deleteXbtSwitchDto(deptCode);
	}
	@Override
	public void updateAmountLimit(String deptCode,String productCode,String loaninvoiceno,String amountLimit,String denyAmountLimit) throws Exception{
		xbtSwichDaoImp.updateAmountLimit(deptCode, productCode, loaninvoiceno,amountLimit,denyAmountLimit);
	}
	@Override
	public Page<XbtSwitchDto> queryRiskList(Page<XbtSwitchDto> page) throws Exception {
		return xbtSwichDaoImp.queryRiskList(page);
	}
	@Override
	public boolean insertAmountLimit(String deptCode, String productCode,
			String loaninvoiceno, String amountLimit,String denyAmountLimit) throws Exception {
		boolean reslut = xbtSwichDaoImp.insertAmountLimit(deptCode, productCode, loaninvoiceno,amountLimit,denyAmountLimit);
		return reslut; 
	}
	@Override
	public Map<String,String> writeBackThisLimit(Map<String, String> map) throws Exception {
		
		return xbtSwichDaoImp.writeBackThisLimit(map);
	}
}
